#include "rockarray.hh"
#include <iostream>

int main()
{
    RockArray rocks {"./src/day14/input.txt"};
    
    for (std::size_t i = 0; i < 250000000; ++i)
    {
        auto temp {rocks.clone()};
        
        rocks.rollNorth();
        rocks.rollWest();
        rocks.rollSouth();
        rocks.rollEast();

        if (temp == rocks) break;
    }

    
    std::cout << rocks.getTotalLoad() << std::endl; 

    return 0;
}